package com.example.knowledge.mvvm.viewmodel

import androidx.lifecycle.MutableLiveData
import com.example.knowledge.api.ApiManager
import com.example.knowledge.mvvm.bean.ReportDetailBean
import com.gsafety.library.Base.BaseViewModel
import com.gsafety.libraryktx.expand.enqueue
import com.gsafety.libraryktx.net.api.request.RequestParamsManager

/**
 * @author : lj
 * @date : 2021/1/20 14:36
 */
class ReportDetailViewModel : BaseViewModel(){
    var mReportRiskValue = MutableLiveData<ReportDetailBean>()
    fun requestriskReport(id:String){
        enqueue(ApiManager.apiService.selectListById(RequestParamsManager.reportDetail(id)),onSuccess={ result ->
            mReportRiskValue.value = result
        },onFail={ error->
            mReportRiskValue.value = null
        })
    }
}